<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%campaign_label}}".
 *
 * @property integer $id
 * @property integer $advertiser_id
 * @property string $name
 * @property string $description
 * @property integer $status
 * @property integer $creator
 * @property string $creator_name
 * @property string $last_update
 */
class CampaignLabel extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%campaign_label}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['advertiser_id', 'name'], 'required'],
            [['advertiser_id', 'status', 'creator'], 'integer'],
            [['description'], 'string'],
            [['last_update'], 'safe'],
            [['name'], 'string', 'max' => 128],
            [['creator_name'], 'string', 'max' => 64],
            [['advertiser_id', 'name'], 'unique', 'targetAttribute' => ['advertiser_id', 'name'], 'message' => 'The combination of Advertiser ID and Name has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'advertiser_id' => 'Advertiser ID',
            'name' => 'Name',
            'description' => 'Description',
            'status' => 'Status',
            'creator' => 'Creator',
            'creator_name' => 'Creator Name',
            'last_update' => 'Last Update',
        ];
    }
}
